import ajax from "@/utils/request";
interface iData {
    tel?: string,
    telcode?: string,
    password?: string,
    loginname?: string
}
//注册接口--验证手机号是否被注册过
export function docheckphoneFn(data: iData) {
    return ajax({
        url: '/user/docheckphone',
        method: 'post',
        data
    })
}

//发送验证码
export function dosendmsgcodeFn(data: iData) {
    return ajax({
        url: '/user/dosendmsgcode',
        method: 'post',
        data
    })
}
//验证验证码
export function docheckcodeFn(data: iData) {
    return ajax({
        url: '/user/docheckcode',
        method: 'post',
        data
    })
}
//注册
export function dofinishregisterFn(data: iData) {
    return ajax({
        url: '/user/dofinishregister',
        method: 'post',
        data
    })
}
//登录
export function loginFn(data: iData) {
    return ajax({
        url: '/user/login',
        method: 'post',
        data
    })
}
//修改密码n
export function updatePasswordFn(data: {
    userid: string,
    oldpassword: string,
    newpassword: string,
    header: { token: string }
}) {
    return ajax({
        url: '/user/updatePassword',
        method: 'get',
        data
    })
}

//查看全部订单
export function orderlistFn(data: {
    userid: string,
    header: { token: string }
}) {
    return ajax({
        url: 'user/orderlist',
        method: 'post',
        data
    })
}
